<style scoped>
.ddd{
    padding:0 10px;
}
</style>
<template>
<div class="logo">
    <div class="top">
        <span>欢迎 <b>{{data.username}}</b></span>
        
    </div>
    
    <el-row class="ddd">
        <el-col :span="12">
            <el-button type="text" @click="out">退出登录</el-button>
        </el-col>
        <el-col :span="12">
            <el-button  @click="$router.push('/admin/home')">前往后台</el-button>
        </el-col>
    </el-row>
</div>
</template>

<script>
export default {
    data (){
        return {
            data:{}
        }
    },
    created(){
        this.data = JSON.parse(this.$store.state.qiantai.token);
    },
    methods:{
        out(){
            this.$confirm('真的真的要退出吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$store.commit('qiantai/reToKen','');
                this.$message({
                    type: 'success',
                    message: '退出成功!'
                });
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '取消退出~'
                });          
            });
        }
    }
}
</script>